package com.atguigu.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @author durant
 * @create 2021-10-31 14:31
 */
@Controller
public class TestController {
    @RequestMapping(value = {"/hello","/test","/lala"},method = {RequestMethod.GET},params = {"username","password!=123456"})
    public String hello(){
        return "hello";
    }
    @RequestMapping(value = "/")
    public String index(){
        return "index";
    }
    @RequestMapping(value = "/testParamsHeaders",params = {"username"},headers = {"Host=localhost:8081"})
    public String testParamsHeaders(){
        return "hello";
    }
    @RequestMapping(value = "/a?a/testAnt")
    public String testAnt(){
        return "success";
    }

    @RequestMapping("/param")
    public String param(){
        return  "test_param";
    }
}
